The Dreamweaver JavaScript API > Behavior functions > dreamweaver.getBehaviorTag() |
![]() ![]() ![]() |
Availability
Dreamweaver1.2
Description
Gets the source of the tag to which the behavior is being applied. This function is applicable only in action files.
Arguments
None.
Returns
A string representing the source of the tag. This is the same string that is passed as an argument (HTMLelement
) to the canAcceptBehavior()
function. If this function appears outside of an action file, the return value is an empty string.
Enabler
None.
Example
If you write an action that can be applied only to a hyperlink (A HREF
), you can use getBehaviorTag()
as part of the function that initializes the user interface for the Parameters dialog box.
function initializeUI(){ var theTag = dreamweaver.getBehaviorTag().toUpperCase(); var CANBEAPPLIED = (theTag.indexOf('HREF') != -1)); if (CANBEAPPLIED) { // display the action UI } else{ // display a helpful message that tells the user // that this action can only be applied to a // hyperlink } }
![]() ![]() ![]() |